package com;

import com.dao.ChatterDAO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
public class NicknameValidation {
    @Resource
    private ChatterDAO chatterDAO;

    @Transactional
    public boolean validate(String name) {
        return !(chatterDAO.countUsers(name) > 0);
    }
}
